search entry: Don't propagate handled events
authorMatthias Clasen <mclasen@redhat.com>
Thu, 10 Sep 2020 02:26:27 +0000 (22:26 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 10 Sep 2020 02:26:27 +0000 (22:26 -0400)
When the text says it has handled the event,
trust it. We don't want to emit ::search-started
if the content hasn't changed, but we still
should not propagate e.g. an Insert key press
if it has already toggled overwrite mode in
the text.

Fixes: #2874
gtk/gtksearchentry.c

index ece8cc0c28844086a74181db70cf588bee3aca77..80304901b69a241642ebd866f734a9ef762ba4f1 100644 (file)
@@ -593,9 +593,9 @@ capture_widget_key_handled (GtkEventControllerKey *controller,
 
   handled = gtk_event_controller_key_forward (controller, entry->entry);
 
-  if (handled && entry->content_changed && !entry->search_stopped)
+  if (handled)
     {
-      if (was_empty)
+      if (was_empty && entry->content_changed && !entry->search_stopped)
         g_signal_emit (entry, signals[SEARCH_STARTED], 0);
 
       return GDK_EVENT_STOP;